package com.itheima.springbootmybatis.mapper;

import com.itheima.springbootmybatis.pojo.Merchant;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {


    //根据用户名查询用户
    @Select("select * from merchant where username=#{username}")
    Merchant findByUserName(String username);

    //添加
    @Insert("insert into merchant(username,password,nickname,contact_phone,contact_address,create_time,update_time)" +
            " values(#{username},#{password},#{nickname},#{contactPhone},#{contactAddress},now(),now()) ")
    void add(String username, String password,String nickname,String contactPhone,String contactAddress);

}
